$(function() {

	
	// 校验弹框输入数据
	$("#addForm").validate({
		errorElement : 'span',
		errorPlacement : function(error, element) {
			error.appendTo(element.parent());
		},
		rules : {
			identContent : "required"
		},
		msgs : {
			identContent : "请输入鉴定内容",
		},
		submitHandler : function(form) {
			$('#saveBtn').attr("disabled",true);
		    setTimeout("$('#saveBtn').removeAttr('disabled')",3000);

			 var form = new FormData(document.getElementById("addForm"));
				
			 $.ajax({
	                url:"addShopIdentInfo",
	                type:"post",
	                dataType:"json",
	                data:form,
	                processData:false,
	                contentType:false,
	                success:function(data){
	                	if(data.code == 200){
	                		setTimeout(function(){
	    						layer.msg("添加成功", {icon : 1,time : 1500});
	    						$(form).resetForm();
	    						layer.closeAll('loading');
	    						$("#modal-add").modal('hide');
	    						$("#table").bootstrapTable('refresh');
	    					},1500);
	                	}
	                },
	                error:function(e){
	                	layer.msg("添加失败", {icon : 2,time : 1500,});
						layer.closeAll('loading');
	                }
	            });       
			
			layer.load(2);
		},
	});
	
});
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	/*$("#aa").click(function(){
		alert("aa");
		var data= [{name:"jon",age:"12"},{name:"jic",age:"18"},{name:"petter",age:"14"}]
		$.post(
				"addOrderInfo", 
				{
				or:JSON.stringify(data)  
				 },function(data) {
			if(data.code == 200){
				
			}
		}, "json");
	});
*/
	
   /*$("#aa").click(function(){
	  
	   $.ajax({
	        url: "http://127.0.0.1:8080/adicms/api/login",
	        data: {
	        	loginname: "admin",
	        	password: "admin"
	        }, 
	        beforeSend: function(request) {
	            request.setRequestHeader("token","900be2a2T33BtmsY8e92T33BtmsY4a90T33BtmsY8458T33BtmsYd5a27deba9f5");
	        },
	        dataType: 'JSON',
	        async: false,//请求是否异步，默认为异步
	        success: function (list) {
	        },
	        error: function () {
	        }
	    });
   });*/

